package user.com.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import user.com.interceptor.UserInfoInterceptor;

@Configuration
public class UserInfoConfiguration implements WebMvcConfigurer {

    @Value("${file.path}")
    private String filePath;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new UserInfoInterceptor())
//                .addPathPatterns("/user/**")
//                .excludePathPatterns("/user/getById/**" , "/user/getUserInfoByToken/**" ,"loginWithPass");
    }



    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry){
        registry.addResourceHandler("/image/**").addResourceLocations("file:" + filePath);
    }
}
